import mapModelColorGet from '@/utils/maputils/mapModelColorGet.js';

const SencelayerRenderer = {
  model_hightrenderer(objectids,layername,fieldname) {
    
    let model_hightrenderer = {
      type: "unique-value",
      field: fieldname,
      defaultLabel: "",
      defaultSymbol: {},
      uniqueValueInfos: []
    };

    if (layername === 'basemap_zw_baimodel'){
        model_hightrenderer.defaultSymbol={
           type: "mesh-3d",
           symbolLayers: [{
             type: "fill",
             material: {
               color: [255, 255, 255, 1],
               colorMixMode: "replace"
             },
             edges: {
               type: 'solid',
               color: [0, 0, 0, 0.6],
               size: 1
             }
           }]
         }
    } else if (layername === 'basemap_as_baimodel') {
       model_hightrenderer.defaultSymbol = {
         type: "mesh-3d",
         symbolLayers: [{
           type: "fill",
           material: {
             color: [77, 126, 176, 1],
             colorMixMode: "replace"
           },
           edges: {
             type: 'solid',
             color: [0, 0, 0, 0.6],
             size: 1
           }
         }]
       }
    }else{
     model_hightrenderer.defaultSymbol = {
         type: "mesh-3d",
         symbolLayers: [{
           type: "fill",
           material: {
             color: [77, 126, 176, 1],
             colorMixMode: "tint"
           },
           edges: {
             type: 'solid',
             color: [0, 0, 0, 0.6],
             size: 1
           }
         }]
       }
    }
    objectids.map(function (item, key, ary) {
      let uniquesymbol = {
        label: fieldname,
        symbol: {},
        value: item
      };
      
     uniquesymbol.symbol = {
         type: "mesh-3d",
         symbolLayers: [{
           material: {
            // color: [0, 255, 255, 1],
            //  colorMixMode: "multiply"
           },
           type: "fill",
           edges: {
            //  type: "solid",
            //  color: [0, 0, 0, 0],
            //  transparency: 60,
            //  size: 1
           }
         }]
     }
      
      model_hightrenderer.uniqueValueInfos.push(uniquesymbol);
    });
    return model_hightrenderer;
  }
}
export default SencelayerRenderer;
